package com.kugong.signUp;

import com.jfinal.core.Controller;
import com.jfinal.validate.Validator;

/**
 * SignUpValidator.
 */
public class SignUpValidator extends Validator {
	
	protected void validate(Controller controller) {

		validateRegex("SignUp.name", ".*#\\d{1,10}\\b","titleMsg", "请输入正确的战网ID，如：昵称#2333");
//		validateEmail("SignUp.contact", "contentMsg", "请输入正确的邮箱地址");

	}
	
	protected void handleError(Controller controller) {
		controller.keepModel(SignUp.class);
		controller.keepPara("SignUp.name");
		controller.keepPara("SignUp.contact");
		String actionKey = getActionKey();
		if (actionKey.equals("/SignUp/addSignUp"))
			controller.render("SignUp.jsp");
	}
}
